import 'package:get/get.dart';
import 'package:xinxuan/http/http_util_service.dart';
import 'package:xinxuan/vo/system_address_list_vo.dart';

class AddressCityController extends GetxController {
  
  /// 市列表
  var cityArr = <SystemAddressItem>[].obs;

  @override
  void onReady() {
    Map<String, dynamic> argumentsMap = Get.arguments;
    int id = argumentsMap['id'];
    getCityList(id);
    super.onReady();
  }

  /// 获取市列表
  getCityList(int id) async {
    SystemAddressListVo systemAddressListVo = await HttpUtilService.getSystemRegions(parentId: id);
    cityArr.value = systemAddressListVo.data!;
    update();
  }
}